#ifndef GAME_H_INCLUDED
#define GAME_H_INCLUDED

#include "common.h"
#include "gameboard.h"
#include <string>
#include <stdexcept>

class Game{

private:
    GameBoard *_gb;
    ALLEGRO_BITMAP* _renderImg;
    ALLEGRO_BITMAP* _sideMenuBMP;

    int _score;
    int _stage;
    int _state;

    enum en_game_state{GAME,NEXT_STAGE,END_GAME};

    ALLEGRO_BITMAP* renderSideMenu();
    void load_stage(int new_stage);
    void change_state(int new_state);

public:
    Game();

    ALLEGRO_BITMAP* render();

    //GameBoard* gameboard() { return _gb; }
    inline void restart(){ std::cout<< "RESTART"; load_stage(_stage); }
    inline void move_player(int m){if(_gb->move_player(m)) _score+=1;}
    inline void move_boxes(){_gb->move_boxes();}

    void check_stage_complete();


};


#endif // GAME_H_INCLUDED
